<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>员工个人修改密码页面</title>
    <#include "../common/link.ftl" >
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
    <#include "../common/navbar.ftl" >
    <!--菜单回显-->
    <#assign currentMenu="employee"/>
    <#include "../common/menu.ftl" >
    <div class="content-wrapper">
        <section class="content-header">
            <h1>员工个人修改密码</h1>
        </section>
        <section class="content">
            <div class="box">

                <#-- 表单 -->
                <form class="form-horizontal" action="/employee/editPasswordDo.do" method="post" id="editForm">
                    <br>
                    <br>
                    <input type="hidden" value="${(entity.id)!}" name="id">

                    <div class="form-group">
                        <label for="password" class="col-sm-2 control-label">当前员工：</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" id="name" name="name" disabled
                                   value="${(entity.name)!}">
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="password" class="col-sm-2 control-label">原密码：</label>
                        <div class="col-sm-6">
                            <input type="password" class="form-control" id="oldPassword" name="oldPassword"
                                   placeholder="请输入原密码">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="repassword" class="col-sm-2 control-label">新密码：</label>
                        <div class="col-sm-6">
                            <input type="password" class="form-control" id="newPassword" name="newPassword"
                                   placeholder="请输入新密码">
                        </div>
                    </div>


                    <div class="form-group">
                        <div class="col-sm-offset-1 col-sm-6">
                            <button id="submitBtn" type="button" class="btn btn_editPassword btn-primary">修改</button>
                            <button type="reset" class="btn btn-danger btn_goback">返回</button>
                        </div>
                    </div>
                    <br>
                    <br>
                </form>

                <script>
                    $(function () {
                        //修改按钮绑定事件
                        $('.btn_editPassword').on('click',function () {
                            //表单提交
                            $('#editForm').ajaxSubmit(function (data) {
                                checkData(data, "/login.html", "密码修改成功，请重新登录");
                            });
                        });

                        //返回按钮绑定事件
                        $('.btn_goback').on('click',function () {
                            history.go(-1);
                        });
                    });
                </script>
            </div>
        </section>
    </div>
    <#include "../common/footer.ftl" >
</div>
</body>
</html>
